(function() {
  var $form_valid;

  $form_valid = [false, false, false, false, false];

  $(function() {
    $('#username-box').change(function(event) {
      return console.log(event);
    });
    return $('#submit-btn').click(function() {
      var params;
      if (_.contains($form_valid, false)) {
        $.meow({
          message: "You can't sign up until you've completed the form."
        });
      }
      params = {
        u: $('#username-box').val(),
        i: $('#id-box').val(),
        e: $('#email-box').val(),
        p: hash($('#password-box').val())
      };
      return $.post('/signup/school/validate', params, function(data) {
        if (data.error != null) {
          return $.meow({
            message: "The server doesn't like your values ... Check the form is valid, and if it is then <a href='/contact'>contact us!</a>"
          });
        } else {
          $('#main').fadeOut();
          return $('#validate').fadeIn();
        }
      });
    });
  });

}).call(this);
